package com.lanou.musicproject.net;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.lanou.musicproject.base.BaseApplication;

/**
 * Created by 王世美 on 2015/10/21.
 * Volley的请求队列，单利模式保证一个App只有一个请求队列
 */
public class MyQueue {
   RequestQueue requestQueue;
    static MyQueue myQueue;
    private MyQueue(){
        requestQueue = Volley.newRequestQueue(BaseApplication.getAppContext());
    }

    public static MyQueue getInstance(){
        if(myQueue==null){
            myQueue = new MyQueue();
        }
        return myQueue;
    }

    public RequestQueue getVolleyQueue(){
        return requestQueue;
    }
}
